<template>
  <div class="fixed" v-dialogDrag>
    <div class="content el-dialog"
         style="padding:0;width:50%">
      <div class="msgTop el-dialog__header">
        <span>参数转换</span>
        <i class="el-icon-close fr"
           style="cursor:pointer;line-height:40px;font-size:13px;"
           @click="cancelTransfer"></i>
      </div>
      <el-form ref="ruleForm"
               class="demo-ruleForm"
               style="padding:20px 20px 0 20px"
               label-width="100px">
        <el-form-item>
          <el-table ref="multipleTable"
                  border
                  :data="workOrderFieldReflect"
                  height="300"
                  tooltip-effect="dark">
          <el-table-column prop="innerFieldName"
                           label="参数名称">
          </el-table-column>
          <el-table-column prop="innerFieldMeaning"
                           label="参数描述">
          </el-table-column>
          <el-table-column prop="externalFieldName"
                           label="对应参数名称">
            <template slot-scope="scope">
              <el-input type="text"
                        v-model="scope.row.externalFieldName"
                        placeholder="请输入参数名称"></el-input>
            </template>
          </el-table-column>
          <el-table-column prop="externalFieldValue"
                           label="默认值（如需）">
            <template slot-scope="scope">
              <el-input type="text"
                        v-model="scope.row.externalFieldValue"
                        placeholder="请输入值"></el-input>
            </template>
          </el-table-column>
             
          </el-table>
        </el-form-item>
        <el-form-item >
          <el-button type="primary"
                   class="el-button el-button--primary el-button--medium h30Btn fr"
                   @click="submitForm">确定</el-button>
            <el-button type="primary"
                      class="el-button el-button--primary el-button--medium h30Btn fr"
                      @click="cancelTransfer">取消</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
export default {
  props: ["workOrderFieldReflect", "indexValue"],
  data () {
    return {
      startWorkOrderFieldReflect: {}
    }
  },
  mounted () {
    this.transData()
  },
  methods: {
    transData () {
      this.startWorkOrderFieldReflect = this.workOrderFieldReflect
    },
    cancelTransfer () {
      let paramsMapInfo = {
        show: false,
        index: this.indexValue,
        data: this.startWorkOrderFieldReflect
      }
      this.$emit('changeShow', paramsMapInfo)
    },
    submitForm () {
      let paramsMapInfo = {
        show: false,
        index: this.indexValue,
        data: this.workOrderFieldReflect
      }
      this.$emit('changeShow', paramsMapInfo)
    }
  }
}
</script>

<style scoped>
.center {
  text-align: center;
  font-size: 16px;
}
.h30Btn {
  margin: 10px;
}
>>>.el-form-item__content {
  margin-left:0 !important;
}
</style>
